<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(first,last,age,gender,interest) {
            this.name = {
                "first": first,
                "last": last
            },
            this.age = age;
            this.gender = gender;
            this.interest = interest;
            this.bio = function() {
                console.log(this.name.first + ' ' + this.name.last + ' is ' + this.age + ' year old . he like '+ this.interest[0] + ' and '+ this.interest[1] + ' .');
            }
            this.greeting = function() {
                console.log('Hi! I\'m ' + this.name.first + '.')
            }
        }

        var person1 = new Person('bob','smith',32,'fmale',['music','skiing'])
        console.log(person1['age']);
        console.log(person1.interest[1]);
        person1.bio()

        var dog1 = new Object();
        dog1.name = "xioahuang";
        dog1['age'] = 1;
        dog1.action = function() {
            console.log('my name is ' + this.name)
        }
        console.log(dog1.name)

        var dog2 = Object.create(dog1);
        console.log(dog2.name)
    </script>
</body>
</html>